package jdk.ch1;

import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

public class DaemonT {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            while (true) {
                try {
                    System.out.println("executing");
                    TimeUnit.SECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        thread.setDaemon(true);
        thread.start();
        System.out.println("main exit");
        ArrayList<Object> objects = Lists.newArrayList();

    }
}
